<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <link rel="stylesheet" href="/static/js/bootstrap-3.3.2-dist/css/bootstrap.css">
    <script src="/static/js/jquery/jquery-2.1.3.min.js"></script>
    <script src="/static/js/jquery.form.js"></script>
    <script type="text/javascript" src="/static/js/jquery.twbsPagination.min.js"></script>
    <script src="/static/js/jquery.bootstrap.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#pagination').twbsPagination({
                        totalPages:${pageInfo.pages} || 1,
                    startPage:${pageInfo.pageNum} || 1,
                    visiblePages:5,
                    first : "首页",
                    prev : "上一页",
                    next : "下一页",
                    last : "最后一页",
                    onPageClick : function(event, page) {
                $("#currentPage").val(page);
                $("#searchForm").submit();
            }

        });
            $("#query").click(function(){
                $("#currentPage").val(1);
                $("#searchForm").submit();
            });


        })

      /*  $(function () {
            $("#btn_deliver").click(function(){
                $("#searchForm").ajaxSubmit(function (data) {
                    if(data.success){
                        $.messager.pop("订单已确定");
                        window.location.reload();
                    }else {
                        $.messager.popup(data.msg);
                    }
                })
            })
        })*/

    </script>
</head>
    <body>
    <form id="searchForm" class="form-inline" method="post" action="/changeShippingStatus">
        <input type="hidden" id="currentPage" name="currentPage" value="1"/>
        <div class="form-group">
            <label for="orderSn">订单编号</label>
            <input type="text" class="form-control" id="orderSn" name="orderSn" value="${(qo.orderSn)!''}" >
        </div>
        <div class="form-group">
            <label for="consignee">客户</label>
            <input type="text" class="form-control" id="consignee"  name="consignee" value="${(qo.consignee)!''}">
        </div>
        <div  class="form-group">
        <button id="query" type="button" class="btn btn-success"><i class="icon-search"></i>查询</button>
        </div>
        <table class="table table-hover">
            <thead>
            <tr>
               <th>订单编号</th>
               <th>客户</th>
               <th>订货日期</th>
               <th>订单状态</th>
               <th>收货信息</th>
               <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <#list pageInfo.list as order>
            <tr>
                <td>${order.orderSn}</td>
                <td>
                    ${order.consignee}<br/>
                    ${order.mobile}
                </td>
                <td><script type="text/javascript">
                     var date = new Date(${order.addTime});
                     var month = date.getMonth() +1;
                     var time = date.getFullYear()+"/"+month+"/"+date.getDay()+'<br/>'+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
                     document.write(time);
                </script></td>
                    <td>${order.orderStatus}</td>
                <td>${order.shippingStatus}</td>
                <td>
                    <a href="changeShippingStatus?id=${order.orderId}">
                        <input type="button" value="确认发货" id="btn_deliver">
                    </a>
                </td>

            </tr>
            </#list>
            </tbody>
        </table>
        <div style="text-align: center;">
            <ul id="pagination" class="pagination"></ul>
        </div>
    </form>

    </body>
</html>




